<template>
  <div>
    <table-title :title="title"></table-title>
    <el-table :data="dataList">
      <el-table-column v-for="item in columns"  :label="item.label"
      :prop="item.prop">
        <template v-if="item.slot" #default="{row}">
          <div>
             <slot :name="item.slot" :scope="row"></slot>
          </div>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination layout="prve,pager,next" background @current-change="pageChange" :total="total"> </el-pagination>
  </div>
</template>

<script setup lang="ts">
    import {defineProps,defineEmits} from 'vue'
    let emit=defineEmits(["sendPage"])
    let pageChange=(val:any)=>{
      // 传递当前页码
        emit("sendPage",val)
    }
    defineProps({
      total:{
        type:Number
      },
      title:{
        type:String      
      },
      columns:{
        type:Array<any>,
        default(){
          return []
        }
      },
      dataList:{
          type:Array<any>,
          default(){
            return []
          }
      }
    })
</script>
